body {
    background: #f0f2f5;
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 20px;
}

.game-container {
    margin: 0 auto;
    text-align: center;
    max-width: 95%;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: auto;
    position: relative;
    z-index: 1;
}

.controls {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

select, button {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
}

select {
    background: #f5f5f5;
    cursor: pointer;
}

button {
    background: #4CAF50;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: #45a049;
}

.stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
    font-size: 18px;
}

.stat-item {
    background: #f5f5f5;
    padding: 10px 20px;
    border-radius: 5px;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.board-wrapper {
    overflow: auto;
    max-width: 100%;
    margin: 0 auto;
    padding: 10px;
}

.board {
    display: inline-block;
    background: #e0e0e0;
    padding: 10px;
    border-radius: 8px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

.row {
    display: flex;
}

.cell {
    width: 30px;
    height: 30px;
    border: 1px solid #bbb;
    background: linear-gradient(145deg, #f0f0f0, #e6e6e6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    font-size: 16px;
    margin: 1px;
    border-radius: 3px;
    user-select: none;
}

@media (max-width: 768px) {
    .cell {
        width: 25px;
        height: 25px;
        font-size: 14px;
    }
}

.cell:hover {
    transform: scale(1.05);
}

.revealed {
    background: white;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}

.mine {
    background: #ff4444;
    animation: explode 0.5s ease-out;
}

.flag {
    background: #ffeb3b;
}

.number-1 { color: #2196F3; }
.number-2 { color: #4CAF50; }
.number-3 { color: #f44336; }
.number-4 { color: #9C27B0; }
.number-5 { color: #795548; }
.number-6 { color: #607D8B; }
.number-7 { color: #000000; }
.number-8 { color: #787878; }

@keyframes explode {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.game-over {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 24px;
    z-index: 1000;
    text-align: center;
}

.help-tooltip {
    position: relative;
    display: inline-block;
}

.help-tooltip .tooltip-text {
    visibility: hidden;
    background-color: black;
    color: white;
    text-align: left;
    padding: 10px;
    border-radius: 6px;
    position: absolute;
    z-index: 1;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    font-size: 14px;
    line-height: 1.4;
}

.help-tooltip:hover .tooltip-text {
    visibility: visible;
}

.emoji {
    font-size: 24px;
    cursor: pointer;
    margin: 0 5px;
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a1a;
        color: #ffffff;
    }

    .game-container {
        background: #2d2d2d;
    }

    .cell {
        background: linear-gradient(145deg, #3d3d3d, #2d2d2d);
        border-color: #4d4d4d;
    }

    .revealed {
        background: #3d3d3d;
    }

    .stat-item {
        background: #3d3d3d;
        color: #ffffff;
    }

    select {
        background: #3d3d3d;
        color: #ffffff;
    }
}

.difficulty-label {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #4CAF50;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
}